package com.jlpay.openapi.demo.openmerch.register;

import com.jlpay.open.jlpay.sdk.java.model.BaseResponse;
import com.jlpay.open.jlpay.sdk.java.model.openmerch.register.request.IncomingCancelRequest;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author liaochangyi
 * @since 2024/6/30
 */
public class IncomingCancelService {

    private static final Logger LOGGER = LoggerFactory.getLogger(IncomingCancelService.class);

    public static void main(String[] args) {
        IncomingCancelRequest incomingQueryRequest = buildIncomingCancelRequest();
        BaseResponse incomingCancelResponse = JlpayOpenApiService.openMerchService()
                .post(incomingQueryRequest, BaseResponse.class);
        LOGGER.info("撤销申请单响应:{}", JsonUtils.toString(incomingCancelResponse));
    }

    private static IncomingCancelRequest buildIncomingCancelRequest() {
        IncomingCancelRequest incomingCancelRequest = new IncomingCancelRequest();
        // 申请单号
        incomingCancelRequest.setApplyId("lcy_incoming_uat_20250630_0001");
        return incomingCancelRequest;
    }

}
